﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KCL.Code.Business;
using System.Data;

namespace KCL.Organization
{
    public partial class StaffList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //DataTable staffTab =  UserServices.GetStaffList();

            //if (staffTab != null)
            //{
            //    gridStaffList.DataSource = staffTab;
            //    gridStaffList.DataBind();
            //    staffTab.Dispose();
            //}
        }

        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int id = 3;
            bool isDeleted = UserServices.DeleteUserByID(id);

            if (isDeleted == true)
            {
                this.Page.Response.Write("Deleted userID = " + id.ToString());
            }
        }

        protected void RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int id = (int)gridStaffList.DataKeys[e.RowIndex].Value;
            UserServices.DeleteUserByID(id);
        }
    }
}